﻿using AkazoNobel.Scheduler.Core;
using AkazoNobel.Scheduler.StoreMasterData.Common;
using AkazoNobel.Scheduler.StoreMasterData.DataAccess.Service;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace AkazoNobel.Scheduler.StoreMasterData.Tasks
{
    public class SapSalesDataSync:BaseTask
    {
        public override void ExecuteTask(IJobExecutionContext context)
        {
            string storedProcName = "SapSalesCodeSync";
            SqlParameter[] pars = new SqlParameter[]
            {
                new SqlParameter("@type","1")
            };
            int times = 600;
            string connectionName = Constant.SMD_DB_NAME;

            string retsapsales = CustomerService.SapSalesCodeSync(storedProcName, pars, times, connectionName);
            string[] retlist = retsapsales.Split(new char[]{ '!'});
            if (retlist.Length > 0)
            {
                Logger.Debug("负责销售同步成功，门店主数据负责销售同步数量：" + retlist[0] + "负责销售表同步负责销售同步数量：" + retlist[1]);
            }
        }
    }
}
